diff --git a/drivers/video/sandbox_dsi_host.c b/drivers/video/sandbox_dsi_host.c
new file mode 100644
index 0000000..cd644ec
--- /dev/null
+++ b/drivers/video/sandbox_dsi_host.c
@@ -0,0 +1,90 @@
+// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
+/*
+ * Copyright (C) 2019, STMicroelectronics - All Rights Reserved
+ */
+
+#include <common.h>
+#include <display.h>
+#include <dm.h>
+#include <dsi_host.h>
+
+/**
+ * struct sandbox_dsi_host_priv - private data for driver
+ * @device: DSI peripheral device
+ * @timing: Display timings
+ * @max_data_lanes: maximum number of data lines
+ * @phy_ops: set of function pointers for performing physical operations
+ */
+struct sandbox_dsi_host_priv {
+	struct mipi_dsi_device *device;
+	struct display_timing *timings;
+	unsigned int max_data_lanes;
+	const struct mipi_dsi_phy_ops *phy_ops;
+};
+
+static int sandbox_dsi_host_init(struct udevice *dev,
+				 struct mipi_dsi_device *device,
+				 struct display_timing *timings,
+				 unsigned int max_data_lanes,
+				 const struct mipi_dsi_phy_ops *phy_ops)
+{
+	struct sandbox_dsi_host_priv *priv = dev_get_priv(dev);
+
+	if (!device)
+		return -1;
+
+	if (!timings)
+		return -2;
+
+	if (max_data_lanes == 0)
+		return -3;
+
+	if (!phy_ops)
+		return -4;
+
+	if (!phy_ops->init || !phy_ops->get_lane_mbps ||
+	    !phy_ops->post_set_mode)
+		return -5;
+
+	priv->max_data_lanes = max_data_lanes;
+	priv->phy_ops = phy_ops;
+	priv->timings = timings;
+	priv->device = device;
+
+	return 0;
+}
+
+static int sandbox_dsi_host_enable(struct udevice *dev)
+{
+	struct sandbox_dsi_host_priv *priv = dev_get_priv(dev);
+	unsigned int lane_mbps;
+	int ret;
+
+	priv->phy_ops->init(priv->device);
+	ret = priv->phy_ops->get_lane_mbps(priv->device, priv->timings, 2,
+					   MIPI_DSI_FMT_RGB888, &lane_mbps);
+	if (ret)
+		return -1;
+
+	priv->phy_ops->post_set_mode(priv->device, MIPI_DSI_MODE_VIDEO);
+
+	return 0;
+}
+
+struct dsi_host_ops sandbox_dsi_host_ops = {
+	.init = sandbox_dsi_host_init,
+	.enable = sandbox_dsi_host_enable,
+};
+
+static const struct udevice_id sandbox_dsi_host_ids[] = {
+	{ .compatible = "sandbox,dsi-host"},
+	{ }
+};
+
+U_BOOT_DRIVER(sandbox_dsi_host) = {
+	.name		      = "sandbox-dsi-host",
+	.id		      = UCLASS_DSI_HOST,
+	.of_match	      = sandbox_dsi_host_ids,
+	.ops		      = &sandbox_dsi_host_ops,
+	.priv_auto_alloc_size = sizeof(struct sandbox_dsi_host_priv),
+};
